#ifndef __DEBUG_H__
#define __DEBUG_H__

typedef enum
{
    DEBUG_INFO,
    DEBUG_WARN,
    DEBUG_ERROR,
    DEBUG_NONE = 0xFF,
} Debug_Level;
/*是否使能打印*/

#define DEBUG_EN 1

#include "stdio.h"
#if (DEBUG_EN == 1)
extern unsigned char debug_level;
extern unsigned char debug_en;
//打印信息
#define DPRINT(level, format, ...)                       \
    do                                                   \
    {                                                    \
        if ((level >= debug_level) && (debug_en == 0xAA)) \
        {                                                \
            printf(format, ##__VA_ARGS__);               \
        }                                                \
    } while (0)
#else
#define DPRINT(format, ...)
#endif

#define ERROR_NONE 0

void debug_init(void);
void debug_led(unsigned char ERRORCODE);
void debug_task(void);
#endif
